<template>
  <basic-container>
    <avue-crud
        v-bind="bindVal"
        v-on="onEvent"
        :page.sync="page"
        v-model="startForm">
      <!-- 菜单按钮 -->
      <template slot="menuLeft">
        <el-button type="primary" v-if="getBtnPermission('downloadTemplateBtn',null,null,false)"
                   @click="downloadTemplate()" size="small">下载导入模板
        </el-button>
        <el-button type="primary" v-if="getBtnPermission('exportExcelBtn',null,null,false)" @click="handlerImportExcel"
                   size="small">导入excel
        </el-button>
        <el-button type="primary" v-if="getBtnPermission('importExcelBtn',null,null,false)" @click="downloadexportExcel()"
                   size="small">导出excel
        </el-button>
      </template>
      <!-- 自动配置映射列 -->
      <template v-for="(column,index) in columns" :slot="column.prop" slot-scope="{type,size,row}">
        <component :is="column.columnComponent" :row="row" :column="column" :rowKey="column.prop"
                   :key="row.id+':'+index"></component>
      </template>

    </avue-crud>
    <!-- 数据导入插件 -->
    <import-excel ref="importExcel"
                  upload-name="数据表配置导入"
                  :upload-key="pageOption.name"
                  :option="pageOption"
                  @importSuccess="refreshChange">

    </import-excel>
  </basic-container>
</template>

<script>
import ImportExcel from "@/components/common/ImportExcel";
import startCrud from "@/mixins/start-crud.js"
const option={
  name: "generator/sysDataTableConfig"
}
export default startCrud({
      components: {ImportExcel},
      data() {
        return {};
      },
      created() {

      },
      methods: {}
    },
    option
)
</script>

<style scoped lang="scss">

</style>
